Closed
Conversation
Reviewer's GuideHardens the Electron desktop shell startup and renderer workspace behavior by introducing multi-candidate Python startup with retries, safer process binding, improved workspace refresh error handling, and a bounded LRU cache for details, while enabling renderer sandboxing. Class diagram for the new LruCache utilityclassDiagram
class LruCache {
-number maxSize
-Map cache
+LruCache(maxSize)
+clear()
+has(key)
+get(key)
+set(key, value)
}
Flow diagram for snapshot refresh loop with error backoff and pauseflowchart TD
A_start[Start refreshSnapshot] --> B_checkUrl{workspace.serverUrl set?}
B_checkUrl -- no --> C_stopLoop[stopRefreshLoop and return]
B_checkUrl -- yes --> D_fetch[Fetch runsIndex, details, errors, brokerHealth, stepbitWorkspace]
D_fetch --> E_success{All required fetches succeed?}
E_success -- yes --> F_updateSnapshot[Update state.snapshot with new data]
F_updateSnapshot --> G_resetStatus[Set snapshotStatus: status ok, error null, lastSuccessAt now, consecutiveErrors 0, refreshPaused false]
G_resetStatus --> H_render[renderWorkspaceState]
E_success -- no --> I_errorPath[Handle fetch error]
I_errorPath --> J_incErrors[consecutiveErrors = previous consecutiveErrors + 1]
J_incErrors --> K_pauseCheck{consecutiveErrors >= maxConsecutiveRefreshErrors?}
K_pauseCheck -- yes --> L_pause[Set refreshPaused true and stopRefreshLoop]
K_pauseCheck -- no --> M_continue[Keep refresh loop running]
L_pause --> N_setErrorStatus[Set snapshotStatus: status error, error message, lastSuccessAt unchanged, consecutiveErrors, refreshPaused]
M_continue --> N_setErrorStatus
N_setErrorStatus --> H_render
H_render --> O_buildAlert[buildRuntimeAlert]
O_buildAlert --> P_errorAlert{snapshotStatus.status is error?}
P_errorAlert -- yes --> Q_showWarn[Show warn alert: API unavailable + optional Automatic refresh paused suffix]
P_errorAlert -- no --> R_otherStates[Show other runtime alerts or none]
subgraph User_retries
S_userClick[User clicks Retry API] --> T_retryWorkspace[retryWorkspaceRuntime]
T_retryWorkspace --> U_restartServer[Optionally restart workspace server]
U_restartServer --> V_resetCounters[Reset snapshotStatus.consecutiveErrors to 0 and refreshPaused to false]
V_resetCounters --> W_refreshOnce[Call refreshSnapshot]
W_refreshOnce --> X_maybeLoop{workspace.serverUrl set and snapshotStatus.status not error?}
X_maybeLoop -- yes --> Y_resumeLoop[ensureRefreshLoop resumes interval]
X_maybeLoop -- no --> Z_noLoop[Do not resume loop]
end
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR hardens the Electron desktop shell startup path by:
research_uistartup with fallback Python candidatesWhy
The desktop shell is the operator-facing bridge into QuantLab.
Startup reliability matters here because the shell is responsible for launching and reaching
research_uibefore the workspace can be used.Scope
This PR does not:
Validation
Validated with:
node --check desktop/main.jsnode --check desktop/renderer/app.jsnode --check desktop/renderer/modules/utils.jsnpm run smokeCurrent note:
npm run smokecurrently fails becauseresearch_uidid not become reachable during the smoke run.Notes
mainbefore opening this PR so the diff only contains the desktop hardening changesSummary by Sourcery
Harden the Electron desktop shell startup and refresh behavior to improve research_ui reliability and keep the UI stable under failures.
New Features:
Bug Fixes:
Enhancements: